Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register modules after app initialization #74

Merged

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented May 11, 2021

If we do this earlier, Zeitwerk will autoload files from other engines.
This, in turn, leads to configuration from the local app's
config/initializers directory not being respected when loading files
from those other engines.

Case in point: When configuring Solidus' order state machine in Solidus
2.11 using Spree::Config.state_machines.order = "MyOrderStateMachineModule", and this change is not in the gem,
Solidus' Spree::Order class is loaded, and the wrong module is
included.

@mamhoff mamhoff force-pushed the register-modules-after-app-initialization branch 3 times, most recently from 086d028 to 59692df Compare May 11, 2021 15:46
If we do this earlier, Zeitwerk will autoload files from other engines.
This, in turn, leads to configuration from the local app's
`config/initializers` directory not being respected when loading files
from those other engines.

Case in point: When configuring Solidus' order state machine in Solidus
2.11 using `Spree::Config.state_machines.order =
  "MyOrderStateMachineModule"`, and this change is not in the gem,
Solidus' `Spree::Order` class is loaded, and the wrong module is
included.
@mamhoff mamhoff force-pushed the register-modules-after-app-initialization branch from 59692df to 516aa3d Compare May 12, 2021 11:30
@mamhoff mamhoff merged commit 3a9438c into AlchemyCMS:main May 12, 2021
@mamhoff mamhoff deleted the register-modules-after-app-initialization branch May 12, 2021 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant